#!/bin/bash

######################################################################
     该脚本将当前目录下的项目的api都推到mvn仓库
######################################################################


for dir in */; do
    # 移除目录名后的斜杠
    dir_name="${dir%/}"
	# 检查是否是 lls-commom-sys 目录，如果是则跳过
    if [[ "$dir_name" == "lls-commom-sys" ]]; then
        echo "跳过目录: $dir_name"
        continue
    fi
	
    if [[ "$dir_name" == "logs" ]]; then
        echo "跳过目录: $dir_name"
        continue
    fi
	
    if [[ "$dir_name" == "zj-common" ]]; then
        echo "跳过目录: $dir_name"
        continue
    fi
	
	if [[ "$dir_name" == "zj-workflow-cloud" ]]; then
        echo "跳过目录: $dir_name"
        continue
    fi
	
	
	
    
    # 以"-"为分隔符分割目录名
    IFS='-' read -ra parts <<< "$dir_name"
    
    # 获取第1个部分并与"service"拼接
    if [ ${#parts[@]} -gt 1 ]; then
        result="${parts[1]}-service-api"
        echo "*****************  mvn clean deploy  -pl $result -am -DskipTests **********************"
		cd $dir_name
		mvn clean deploy  -pl $result -am -DskipTests
		cd ..
    fi
done





